Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#383838",
    number:0,
    v_count:0,
    list: [
      {
        pagePath: "/pages/home/home",
        text: "首页",
        iconPath: "/images/home-gray.png",
        selectedIconPath: "/images/home-cur.png",
        number: "",
      },      
      {
        pagePath: "/pages/company/home",
        text: "装修",
        iconPath: "/images/dpzx.png",
        selectedIconPath: "/images/dpzx-cur.png",
        number: "",
      },
      {
        pagePath: "/pages/xqlist/index",
        text: "",
        iconPath: "/images/fabu_cur.png",
        selectedIconPath: "/images/fabu_cur.png",
        number: "",
      },
      {
        pagePath: "/pages/message/message",
        text: "消息",
        iconPath: "/images/chat.png",
        selectedIconPath: "/images/chat_cur.png",
        number: "",
        v_count:0,
      },

      {
        pagePath: "/pages/user/user",
        text: "我的",
        iconPath: "/images/user.png",
        selectedIconPath: "/images/user-cur.png",
        number: "",
      },
    ],
    // background: '../static/tabbar-bg.png',
    centerImg: "/images/fabu_cur.png",
  },
  
  // attached() {
  //     如果中间凸起跳转 tabbar 页面，则把下面注释打开
  //     if (this.data.selected == 2) {
  //         this.setData({
  //             centerImg: '/static/icon/xinjian.png'
  //         })
  //     } else {
  //         this.setData({
  //             centerImg: '/static/icon/xinjian.png'
  //         })
  //     }
  
  //     显示数字提示
  //     let numi = 'list[3].number'
  //     this.setData({
  //         [numi]: 12
  //     })
  // },

  methods: {
    // 切换 tab 事件
    switchTab(e) {
      const data = e.currentTarget.dataset;
      const path = data.path;
      const index = data.index;
      wx.switchTab({
        url: path,
      });
      // // 跳转页面
      // if (index != 2) {
      //   wx.switchTab({
      //     url: path,
      //   });
      // } else {
      // //中间凸起跳转非tabbar
      // //注意，如果跳转tabbar页面则不进行判断
      //   wx.navigateTo({
      //     url: "/pages/xqlist/index",
      //   });
      // }
    },
  },
});


